:root {
  --primary: #3498db;
  --primary-dark: #2980b9;
  --success: #2ecc71;
  --success-dark: #27ae60;
  --warning: #f39c12;
  --warning-dark: #e67e22;
  --danger: #e74c3c;
  --danger-dark: #c0392b;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --gray: #95a5a6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

.navbar {
  background-color: var(--dark);
  padding: 1rem 2rem;
  display: flex;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  border-radius: 4px;
  transition: all 0.3s;
}

.navbar a:hover {
  background-color: var(--primary);
}

.navbar a.active {
  background-color: var(--primary-dark);
}

.dashboard, .container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-card {
  flex: 1;
  min-width: 150px;
  padding: 1.5rem;
  border-radius: 8px;
  color: white;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background-color: #3498db; /* 新增：总设备数背景色改为蓝色 */
}

.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-danger { background-color: var(--danger); }
.bg-primary { background-color: var(--primary); }

.update-time {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.table-container {
  overflow-x: auto;
  margin-top: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--primary);
  color: white;
  position: sticky;
  top: 0;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

tr:hover {
  background-color: #f1f1f1;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
}

.status-online { background-color: var(--success); }
.status-warning { background-color: var(--warning); }
.status-offline { background-color: var(--danger); }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--primary-dark);
}

.view-detail {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

.status-details {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #666;
}

.device-meta {
  margin: 1.5rem 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-selector {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: var(--light);
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.date-selector select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 150px;
}

.login-error {
  color: white;
  background-color: var(--danger);
  padding: 0.125rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.no-data {
  color: var(--gray);
  font-style: italic;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 1rem;
  }
  
  .navbar a {
    display: block;
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .dashboard, .container {
    padding: 1rem;
  }
  
  .summary-card {
    min-width: calc(50% - 0.5rem);
  }
  
  th, td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}
